package com.hzlj.position.config.service;

import com.google.common.util.concurrent.RateLimiter;
import com.hzlj.position.config.common.dto.common.TaskConfig;
import com.hzlj.position.config.common.dto.operatorConfig.OperatorConfigQueryResultDTO;
import com.hzlj.position.config.rest.operator.OperatorLocateRest;
import lombok.Data;

import java.util.List;

/**
 * 定位-运营商配置表(OperatorConfig)表服务接口
 *
 * @author lifh
 * @date 2023-03-30 17:51:33
 */
public interface OperatorConfigService {

    /**
     * 查询列表：不分页
     */
    List<OperatorConfigQueryResultDTO> listOperatorConfig();

    List<String> channels();

    List<OperatorTaskConfig> taskConfigs();

    OperatorTaskConfig taskConfig(String jgCode, String channel);

    @Data
    class OperatorTaskConfig extends TaskConfig {
        private OperatorLocateRest operatorLocateRest;
        private OperatorConfigQueryResultDTO config;

        public OperatorTaskConfig(OperatorLocateRest operatorLocateRest,
                                  OperatorConfigQueryResultDTO config,
                                  RateLimiter rateLimiter) {
            this.operatorLocateRest = operatorLocateRest;
            this.config = config;
            super.setRateLimiter(rateLimiter);
        }
    }
}
